home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / dvips / MakeTeXPK- < prev    next >
Encoding:
Text File  |  1989-11-26  |  1.9 KB  |  81 lines

  1. #!/bin/sh
  2. #
  3. #   This script file makes a new TeX PK font, because one wasn't
  4. #   found.  Parameters are:
  5. #
  6. #   name dpi bdpi magnification [mode]
  7. #
  8. #   `name' is the name of the font, such as `cmr10'.  `dpi' is
  9. #   the resolution the font is needed at.  `bdpi' is the base
  10. #   resolution, useful for figuring out the mode to make the font
  11. #   in.  `magnification' is a string to pass to MF as the
  12. #   magnification.  `mode', if supplied, is the mode to use.
  13. #
  14. #   Note that this file must execute Metafont, and then gftopk,
  15. #   and place the result in the correct location for the PostScript
  16. #   driver to find it subsequently.  If this doesn't work, it will
  17. #   be evident because MF will be invoked over and over again.
  18. #
  19. #   Of course, it needs to be set up for your site.
  20. #
  21. # DESTDIR=/LocalLibrary/Fonts/TeXFonts/pk
  22. DESTDIR=/home/fonts
  23. # TEMPDIR=/tmp
  24. TEMPDIR=.
  25. NAME=$1
  26. DPI=$2
  27. BDPI=$3
  28. MAG=$4
  29. MODE=$5
  30. FINALNAME=$DESTDIR/$NAME.$DPI'pk'
  31. cd $TEMPDIR
  32. # if test -r /usr/local/lib/tex/fonts/pk/$NAME.$DPI'pk'
  33. if test -r $DESTDIR/$NAME.$DPI'pk'
  34. then
  35. #    echo "$NAME.$DPI'pk' already exists in /usr/lib/tex/fonts/pk"
  36.    echo "$NAME.$DPI'pk' already exists in /home/fonts"
  37.    exit
  38. fi
  39. if test -r $FINALNAME
  40. then
  41.    echo "$FINALNAME already exists!"
  42.    exit
  43. fi
  44. if test ! -w $DESTDIR
  45. then
  46.    mkdir $DESTDIR
  47.    if test ! -w $DESTDIR
  48.    then
  49.       echo "Can't write to $DESTDIR"
  50.       exit
  51.    fi
  52. fi
  53. if test "$MODE" = ""
  54. then
  55.    if test $BDPI = 300
  56.    then
  57.       MODE=imagen
  58.    elif test $BDPI = 400
  59.    then
  60.       MODE=nexthi
  61.    elif test $BDPI = 100
  62.    then
  63.       MODE=nextscreen
  64.    else
  65.       echo "I don't know the mode for $BDPI"
  66.       echo "Have your system admin update MakeTeXPK"
  67.       exit
  68.    fi
  69. fi
  70. mf "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME"
  71. if test ! -r $NAME.$DPI'gf'
  72. then
  73.    echo "Metafont failed for some reason on $NAME.$DPI"gf
  74.    exit
  75. fi
  76. gftopk $NAME.$DPI'gf' $NAME.$DPI'pk'
  77. cp $NAME.$DPI'pk' $DESTDIR
  78. chmod 666 $FINALNAME
  79. rm $NAME.log $NAME.$DPI'pk' $NAME.$DPI'gf' $NAME.tfm
  80. exit
  81.